package com.google.android.mypetrol;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;

public class HistoryListItem extends LinearLayout {

	private TextView mDate;
	private TextView mCost;
	private CheckBox mCheckBox;
	
	public HistoryListItem(Context context, String date, String cost) {
		super(context);

		LayoutInflater factory = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		factory.inflate(R.layout.history_list_item, this);
		
		mDate = (TextView)findViewById(R.id.date);
		mDate.setText(date);
		mCost = (TextView)findViewById(R.id.cost);
		mCost.setText(cost);
		mCheckBox = (CheckBox)findViewById(R.id.label);
	}
	
	public void setDate(String text){
		mDate.setText(text);
	}
	
	public void setCost(String text){
		mCost.setText(text);
	}
	
	public void setChecked(boolean b) {
		mCheckBox.setChecked(b);
	}
	
	public boolean isChecked() {
		return mCheckBox.isChecked();
	}
}
